from models import *
from django.contrib import admin

class XMLFileAdmin(admin.ModelAdmin):
##    fields = []
    list_display = ['name', 'number_of_sentences']

admin.site.register(XMLFile, XMLFileAdmin)

# Don't register XMLContent, too slow
#admin.site.register(XMLContent)

class SentenceAdmin(admin.ModelAdmin):
    fields = ['nb', 'file', 'xml']
    list_display = ['nb', 'file', 'text']

admin.site.register(Sentence, SentenceAdmin)

class NodeAttributeInline(admin.TabularInline):
    model = NodeAttribute
    extra = 2

class TreeNodeAdmin(admin.ModelAdmin):
    list_display = ['nodeName', 'function']
    list_filter = ["nodeName", 'function']
    inlines = [NodeAttributeInline]

admin.site.register(TreeNode, TreeNodeAdmin)


class WordTreeNodeAdmin(admin.ModelAdmin):
##    fields = []
    list_display = ['form', 'lemma', 'cat','subcat',  'ee', 'ei', 'mph']

admin.site.register(WordTreeNode, WordTreeNodeAdmin)
